//
// Created on 2025/7/23.
//
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
// please include "napi/native_api.h".

#ifndef STREAMCORE_REFERENCE_H
#define STREAMCORE_REFERENCE_H
#include <napi/native_api.h>

class NapiReference {
public:
    NapiReference(napi_env env, napi_value value) : env_(env) { napi_create_reference(env, value, 1, &ref_); }
    ~NapiReference() { napi_delete_reference(env_, ref_); }

private:
    napi_env env_;
    napi_ref ref_;
};

#endif // STREAMCORE_REFERENCE_H
